package club.kingyin.commons.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;

import java.io.Serializable;

/**
 * (Log)表实体类
 *
 * @author makejava
 * @since 2022-01-20 15:04:02
 */
@Data
@SuppressWarnings("serial")
@TableName(autoResultMap = true)
public class Log extends Model<Log> {
    //日志ID
    private Integer id;
    //请求URL
    private String url;
    //时间戳
    private Long timestamp;
    //JSON响应
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Object response;
    //JSON请求头
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Object header;
    //JSON请求参数
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Object params;
    //用户ID
    private Integer userid;


    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
    }

